
const query = require('../model/query')
async function templateViews(res, _path, data) {
    let sql = 'SELECT * from system ';
    let bear = await query(sql);
    let obj = {}
    // 加工 数据 得到 完整对象
    bear.forEach((item, i) => {
        let { name, vaule } = item;
        console.log(item,'item');
        // console.log(name);
        obj[name] = vaule;

    });
     console.log(obj);
    setTimeout(()=>{
        res.render(_path,obj)
    },10)
    
}

module.exports = templateViews;